<template>
  <div id="app">
    <!-- <AppAudio /> -->
<!--    <keep-alive>-->
      <router-view />
<!--    </keep-alive>-->
  </div>
</template>
<script>
import store from "./store";
export default {
  components: {
  },
  created() {
    //判断手机还是PC端
    let that = this;
    if (that._isMobile()) {// console.log("手机端");
      store.dispatch("changeMobileState", true);
      that.$router.replace("/");
    } else {// console.log("pc端");
      store.dispatch("changeMobileState", false);
      that.$router.replace("/pchome");
    }
    //ios调用二维码扫描使用方法
    window.localStorage.setItem("scanUrl", location.href.split("#")[0]);
  },
  methods: {
    to(path) {
      that.$router.push({path: path });
    },
    _isMobile() {
      let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
      return flag;
    }
  }
};
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  height: 100%;
}

#nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}

::-webkit-scrollbar-corner,
::-webkit-scrollbar-track {
  background-color: #e2e2e2;
}

::-webkit-scrollbar-thumb {
  border-radius: 0;
  background-color: rgba(0, 0, 0, .3);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
</style>
